//
//  ChainBaseController.h
//  Chain
//
//  Created by zhaosh on 2018/3/30.
//  Copyright © 2018年 zhaosh. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MBProgressHUD.h"
#import "ChainNoDataView.h"
#import "ChainNavBarView.h"

@interface ChainBaseController : UIViewController
@property(strong,nonatomic)UIButton *rightBtn;
@property(strong,nonatomic)UIBarButtonItem *rightBtnItem;
@property(strong,nonatomic)MBProgressHUD *HUD;
@property(strong,nonatomic)UIView *warningView;//无数据,或者提示
@property(strong,nonatomic)UIView *noNetView;//无网络
@property(strong,nonatomic)ChainNoDataView *noDataView;
@property(strong,nonatomic)ChainNavBarView *navBarV;
// 添加顶部视图
-(void)setDefaultNavBarWithTitle:(NSString *)title;

- (void)setHeadView:(UIView *)view withLeftBtnText:(NSString *)leftText withHeadLable:(NSString *)lable withRightBntText:(NSString *)rightText;
/**
 * 导航栏
 *
 * @param view      当前view
 * @param leftText  左边的按钮
 * @param titleText 中间显示的title
 * @param array     右边显示的按钮(多个)
 */
- (void)setHeadView:(UIView*)view withLeftBtnTitle:(NSString *)leftText withCenterTitle:(NSString *)titleText withRightBtnView:(NSArray *)array;

-(void)setHeadView:(UIView *)view withLeftBtnText:(NSString *)leftText withTitle:(NSString *)titleText withImage:(NSString *)imageName withRightBntText:(NSString *)rightText;


// 顶部视图返回的方法
- (void)backAction;

// 顶部视图右上角的点击方法
- (void)searchAction;

/**
 *右边的按钮点击事件
 */
- (void)addAction;

/**
 * 导航中间的按钮点击事件
 */
- (void)titleViewBtnAction;


//展示HUD

/**
 * 加载动画
 */
-(void)showLoading;

-(void)showLoadingWithMessage:(NSString *)message;
/**
 * 可定制的加载动画
 *
 */
-(void) show:(MBProgressHUDMode )_mode message:(NSString *)_message customView:(id)_customView;
/**
 * Toast view
 */
-(void)showRemindWithMessage:(NSString *)message;
/**
 * Toast view 标题 + 详情
 */
- (void)showRemindWithMessage:(NSString *)message detailMessage:(NSString *)detailMessage;

//隐藏HUD
- (void)hideHUDafterDelay:(CGFloat)delay;

//网络状态
-(BOOL) isConnectionAvailable;
-(BOOL) isConnectionWIFI;

-(void)setNavColorWithString:(NSString *)colorStr;
- (void)setupDarkBg;
@end
